﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCThayDoiCoQuanSuDung.ascx.cs"
    Inherits="Viewer.NhanSu.UserControl.UCThayDoiCoQuanSuDung" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Src="~/UserControls/UCQuyetDinh.ascx" TagName="UCQuyetDinh" TagPrefix="uc" %>
<link href="../../resources/css/main.css" rel="stylesheet" type="text/css" />
<%@ Register Src="~/NhanSu/UserControl/UcToChuc.ascx" TagName="UcToChuc" TagPrefix="uc" %>
<style type="text/css">
    body
    {
        color: #57585B; /*dark gray*/
        font-size: 8px;
        font-family: Arial;
    }
</style>
<ext:XScript ID="XScipt1" runat="server">
    <script type="text/javascript">
    
    </script>
</ext:XScript>
<ext:Window ID="wdThayDoiCoQuanSuDung" runat="server" AutoHeight="true" Closable="false"
    Title="Thay đổi cơ quan sử dụng" Modal="true" Icon="TableCell" Width="470" Layout="Fit"
    AutoScroll="true" Hidden="true" Resizable="true" BodyCssClass="window">
    <Items>
        <ext:Panel ID="Panel1" runat="server" Frame="false" Border="false" AutoHeight="true"
            Icon="Information" BodyStyle="background-color: white;">
            <Items>
                <ext:Hidden ID="hdNodeId" runat="server" />
                <ext:Hidden ID="hdToChucThayDoiId" runat="server" />
                <ext:Hidden ID="hdNhanVienId" runat="server" />
                <ext:CompositeField runat="server">
                    <Items>
                        <ext:Label ID="lbl" Width="150" Text="Cơ quan sử dụng hiện tại" runat="server" />
                        <ext:Label ID="lblCoQuanSuDungHienTai" runat="server" />
                    </Items>
                </ext:CompositeField>
                <ext:DisplayField runat="server" Height="3px" />
                <ext:CompositeField runat="server">
                    <Items>
                        <ext:Label Width="150" ID="Label1" Text="Chọn cơ quan muốn thay đổi" runat="server" />
                        <ext:TextField ID="txtCoQuanSuDung_ThayDoiCoQuan" runat="server" ReadOnly="true"
                            Width="150">
                            <ToolTips>
                                <ext:ToolTip ID="ToolTip3" runat="server" AutoHide="true" TrackMouse="true">
                                    <Listeners>
                                        <Show Handler="ShowTip(this,#{txtCoQuanSuDung_ThayDoiCoQuan}.getValue())" />
                                    </Listeners>
                                </ext:ToolTip>
                            </ToolTips>
                        </ext:TextField>
                        <ext:Button ID="Button5" runat="server" Icon="Magnifier" Text="Chọn cơ quan" IconAlign="Right">
                            <Listeners>
                                <Click Handler="#{hdStatus}.setValue('LookUp_ThayDoiCoQuan');#{DirectMethods}.LoadLookUpToChuc_QTCT();" />
                            </Listeners>
                        </ext:Button>
                    </Items>
                </ext:CompositeField>
                <ext:DisplayField ID="DisplayField3" runat="server" Height="3px">
                </ext:DisplayField>
                <ext:CompositeField ID="CompositeField3" runat="server">
                    <Items>
                        <ext:Label Width="150" ID="Label4" Text="Công việc mới" runat="server" />
                        <ext:TextField ID="txtCongViec" runat="server" Width="150">
                            <ToolTips>
                                <ext:ToolTip ID="ToolTip1" runat="server" AutoHide="true" TrackMouse="true">
                                    <Listeners>
                                        <Show Handler="ShowTip(this,#{txtCongViec}.getValue())" />
                                    </Listeners>
                                </ext:ToolTip>
                            </ToolTips>
                        </ext:TextField>
                    </Items>
                </ext:CompositeField>
                <ext:DisplayField ID="DisplayField5" runat="server" Height="3px">
                </ext:DisplayField>
                <ext:CompositeField ID="CompositeField5" runat="server">
                    <Items>
                        <ext:Label Width="150" ID="Label5" Text="Chức vụ mới" runat="server" />
                        <ext:TextField ID="txtChucVu" runat="server" Width="150">
                            <ToolTips>
                                <ext:ToolTip ID="ToolTip2" runat="server" AutoHide="true" TrackMouse="true">
                                    <Listeners>
                                        <Show Handler="ShowTip(this,#{txtChucVu}.getValue())" />
                                    </Listeners>
                                </ext:ToolTip>
                            </ToolTips>
                        </ext:TextField>
                    </Items>
                </ext:CompositeField>
                <ext:DisplayField ID="DisplayField1" runat="server" Height="3px" />
                <ext:CompositeField runat="server">
                    <Items>
                        <ext:Label Width="150" ID="Label2" Text="Lí do thay đổi" runat="server" />
                        <ext:TextArea ID="txtGhiChu" runat="server" Width="257" />
                    </Items>
                </ext:CompositeField>
                <ext:DisplayField ID="DisplayField2" runat="server" Height="3px" />
                <ext:CompositeField ID="CompositeField1" runat="server">
                    <Items>
                        <ext:Label Width="150" ID="Label3" Text="Ngày bắt đầu thay đổi" runat="server" />
                        <ext:DateField Format="dd/MM/yyyy" ID="dtNgayThayDoi" runat="server" AnchorHorizontal="100%"
                            Width="100" SelectedDate="">
                        </ext:DateField>
                    </Items>
                </ext:CompositeField>
            </Items>
            <Content>
                <uc:UCQuyetDinh runat="server" ID="UCQuyetDinh" />
            </Content>
        </ext:Panel>
    </Items>
    <Buttons>
        <ext:Button ID="btnSave" runat="server" Text="Lưu" Icon="Disk">
            <Listeners>
                <Click Handler="
                                 
                                    if(#{txtCoQuanSuDung_ThayDoiCoQuan}.getValue().trim()=='')
                                    {
                                        Ext.MessageBox.alert('Message', 'Bạn chưa chọn cơ quan muốn thay đổi !');                                       
                                        return false;
                                    }
                                   
                                      if(#{txtCoQuanSuDung_ThayDoiCoQuan}.getValue().trim()==#{lblCoQuanSuDungHienTai}.getText().trim())
                                    {
                                        Ext.MessageBox.alert('Message', 'Cơ quan hiện tại và cơ quan muốn thay đổi trùng nhau. Xin vui lòng chọn cơ quan khác!');                                       
                                        return false;
                                    }
                                " />
            </Listeners>
            <DirectEvents>
                <Click OnEvent="btnSaveThayDoiCoQuan_CLick">
                </Click>
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="Button1" runat="server" Text="Đóng" Icon="Cancel">
            <Listeners>
                <Click Handler="#{wdThayDoiCoQuanSuDung}.hide();" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>
<uc:UcToChuc ID="UcToChuc1" runat="server" />
